package xmldots;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * @author Avishai Kopeliansky
 *
 */
public class AboutScreen extends JDialog {

	/**
	 * About Screen Dialog Class
	 */
	private static final long serialVersionUID = 1955813081588741224L;
	private final JPanel contentPanel = new JPanel();
	private JButton okButton;

	/**
	 * Launch the application.
	 * @param args 
	 */
	public static void main(String[] args) {
		try {
			AboutScreen dialog = new AboutScreen();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public AboutScreen() {
		setTitle("About");
		setBounds(100, 100, 424, 220);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		JLabel lblXmlDrawingboardMade = new JLabel("    XML DrawingBoard made by Avishai Kopeliansky ID 066717752");
		GroupLayout gl_contentPanel = new GroupLayout(contentPanel);
		gl_contentPanel.setHorizontalGroup(
			gl_contentPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPanel.createSequentialGroup()
					.addGap(28)
					.addComponent(lblXmlDrawingboardMade, GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE)
					.addGap(43))
		);
		gl_contentPanel.setVerticalGroup(
			gl_contentPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_contentPanel.createSequentialGroup()
					.addGap(35)
					.addComponent(lblXmlDrawingboardMade, GroupLayout.DEFAULT_SIZE, 75, Short.MAX_VALUE)
					.addGap(91))
		);
		contentPanel.setLayout(gl_contentPanel);
		{
			JPanel buttonPane = new JPanel();
			getContentPane().add(buttonPane, BorderLayout.SOUTH);
			{
				okButton = new JButton("OK");
				okButton.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent arg0) {
						dispose();
					}
				});
				okButton.setActionCommand("OK");
				getRootPane().setDefaultButton(okButton);
			}
			GroupLayout gl_buttonPane = new GroupLayout(buttonPane);
			gl_buttonPane.setHorizontalGroup(
				gl_buttonPane.createParallelGroup(Alignment.LEADING)
					.addGroup(gl_buttonPane.createSequentialGroup()
						.addGap(165)
						.addComponent(okButton, GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
						.addGap(179))
			);
			gl_buttonPane.setVerticalGroup(
				gl_buttonPane.createParallelGroup(Alignment.LEADING)
					.addGroup(Alignment.TRAILING, gl_buttonPane.createSequentialGroup()
						.addGap(5)
						.addComponent(okButton, GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
						.addContainerGap())
			);
			buttonPane.setLayout(gl_buttonPane);
		}
	}

}
